home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / gr564s.zip / SRC / MS / CONF.H < prev    next >
C/C++ Source or Header  |  1993-11-05  |  16KB  |  511 lines

  1. /* RCS compile-time configuration for DOS and OS/2 */
  2.  
  3.     /* $Id: conf.h,v 1.10 1992/07/28 16:12:44 eggert Exp $ */
  4.  
  5. /*
  6.  * This RCS compile-time configuration describes DOS and OS/2 hosts.
  7.  * It differs from ../conf.heg as little as possible.
  8.  * Copy this file to ../conf.h.
  9.  * You may have to edit it for your configuration.
  10.  */
  11.  
  12. #define exitmain(n) return n /* how to exit from main() */
  13. /* #define _POSIX_SOURCE */ /* Define this if Posix + strict Standard C.  */
  14.  
  15. #include <errno.h>
  16. #include <stdio.h>
  17. #include <time.h>
  18.  
  19. /* Comment out #include lines below that do not work.  */
  20. #include <sys/types.h>
  21. #include <sys/stat.h>
  22. /* #include <dirent.h> */
  23. #include <fcntl.h>
  24. #include <limits.h>
  25. /* #include <pwd.h> */
  26. #include <signal.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. /* #include <sys/mman.h> */
  30. /* #include <sys/wait.h> */
  31. /* #include <unistd.h> */
  32. /* #include <utime.h> */
  33. /* #include <vfork.h> */
  34.  
  35. /* Define the following symbols to be 1 or 0.  */
  36. #define has_sys_dir_h 0 /* Does #include <sys/dir.h> work?  */
  37. #define has_sys_param_h 0 /* Does #include <sys/param.h> work?  */
  38. #define has_readlink 0 /* Does readlink() work?  */
  39. #define readlink_isreg_errno EINVAL /* errno after readlink on regular file */
  40.  
  41. /* #undef NAME_MAX */ /* Uncomment this if NAME_MAX is broken.  */
  42.  
  43. #if !defined(NAME_MAX) && !defined(_POSIX_NAME_MAX)
  44. #    if has_sys_dir_h
  45. #        include <sys/dir.h>
  46. #    endif
  47. #    ifndef NAME_MAX
  48. #        ifndef MAXNAMLEN
  49. #            define MAXNAMLEN 14
  50. #        endif
  51. #        define NAME_MAX MAXNAMLEN
  52. #    endif
  53. #endif
  54. #if !defined(PATH_MAX) && !defined(_POSIX_PATH_MAX)
  55. #    if has_sys_param_h
  56. #        include <sys/param.h>
  57. #        define included_sys_param_h 1
  58. #    endif
  59. #    ifndef PATH_MAX
  60. #        ifndef MAXPATHLEN
  61. #            define MAXPATHLEN 1024
  62. #        endif
  63. #        define PATH_MAX (MAXPATHLEN-1)
  64. #    endif
  65. #endif
  66. #if has_readlink && !defined(MAXSYMLINKS)
  67. #    if has_sys_param_h && !included_sys_param_h
  68. #        include <sys/param.h>
  69. #    endif
  70. #    ifndef MAXSYMLINKS
  71. #        define MAXSYMLINKS 20 /* BSD; not standard yet */
  72. #    endif
  73. #endif
  74.  
  75. /* Comment out the typedefs below if the types are already declared.  */
  76. /* Fix any uncommented typedefs that are wrong.  */
  77. typedef int mode_t;
  78. /* typedef int pid_t; */
  79. /* typedef int sig_atomic_t; */
  80. /* typedef unsigned size_t; */
  81. typedef int ssize_t;
  82. /* typedef long time_t; */
  83. /* typedef int uid_t; */
  84.  
  85. /* Comment out the keyword definitions below if the keywords work.  */
  86. #define const
  87. /* #define volatile */
  88.  
  89. /* Define the following symbols to be 1 or 0.  */
  90. #define has_prototypes 1 /* Do function prototypes work?  */
  91. #define has_stdarg 1 /* Does <stdarg.h> work?  */
  92. #define has_varargs 0 /* Does <varargs.h> work?  */
  93. #define va_start_args 2 /* How many args does va_start() take?  */
  94. #if has_prototypes
  95. #    define P(params) params
  96. #else
  97. #    define P(params) ()
  98. #endif
  99. #if has_stdarg
  100. #    include <stdarg.h>
  101. #else
  102. #    if has_varargs
  103. #        include <varargs.h>
  104. #    else
  105.         typedef char *va_list;
  106. #        define va_dcl int va_alist;
  107. #        define va_start(ap) ((ap) = (va_list)&va_alist)
  108. #        define va_arg(ap,t) (((t*) ((ap)+=sizeof(t)))  [-1])
  109. #        define va_end(ap)
  110. #    endif
  111. #endif
  112. #if va_start_args == 2
  113. #    define vararg_start va_start
  114. #else
  115. #    define vararg_start(ap,p) va_start(ap)
  116. #endif
  117.  
  118. #define text_equals_binary_stdio 0 /* Does stdio treat text like binary?  */
  119. #define text_work_stdio 0 /* Text i/o for working file, binary for RCS file?  */
  120. #if text_equals_binary_stdio
  121.     /* Text and binary i/o behave the same, or binary i/o does not work.  */
  122. #    define FOPEN_R "r"
  123. #    define FOPEN_W "w"
  124. #    define FOPEN_WPLUS "w+"
  125. #    define OPEN_O_BINARY 0
  126. #else
  127.     /* Text and binary i/o behave differently.  */
  128.     /* This is incompatible with Posix and Unix.  */
  129. #    define FOPEN_R "rb"
  130. #    define FOPEN_W "wb"
  131. #    define FOPEN_WPLUS "w+b"
  132. #    define OPEN_O_BINARY O_BINARY
  133. #    ifndef O_BINARY
  134. #    define O_BINARY 0
  135. #    endif
  136. #endif
  137. #if text_work_stdio
  138. #    define FOPEN_R_WORK "r"
  139. #    define FOPEN_W_WORK "w"
  140. #    define FOPEN_WPLUS_WORK "w+"
  141. #    define OPEN_O_WORK 0
  142. #else
  143. #    define FOPEN_R_WORK FOPEN_R
  144. #    define FOPEN_W_WORK FOPEN_W
  145. #    define FOPEN_WPLUS_WORK FOPEN_WPLUS
  146. #    define OPEN_O_WORK OPEN_O_BINARY
  147. #endif
  148.  
  149. /* Define or comment out the following symbols as needed.  */
  150. /* #define bad_chmod_close 0 */ /* Can chmod() close file descriptors?  */
  151. /* #define bad_creat0 0 */ /* Do writes fail after creat(f,0)?  */
  152. #define bad_fopen_wplus 0 /* Does fopen(f,FOPEN_WPLUS) fail to truncate f?  */
  153. #define getlogin_is_secure 1 /* Is getlogin() secure?  Usually it's not.  */
  154. #define has_dirent 0 /* Do opendir(), readdir(), closedir() work?  */
  155. #define has_fchmod 0 /* Does fchmod() work?  */
  156. #define has_fputs 1 /* Does fputs() work?  */
  157. #define has_ftruncate 0 /* Does ftruncate() work?  */
  158. #define has_getuid 0 /* Does getuid() work?  */
  159. #define has_getpwuid 0 /* Does getpwuid() work?  */
  160. #define has_memcmp 1 /* Does memcmp() work?  */
  161. #define has_memcpy 1 /* Does memcpy() work?  */
  162. #define has_memmove 1 /* Does memmove() work?  */
  163. #define has_madvise 0 /* Does madvise() work?  */
  164. #define has_mmap 0 /* Does mmap() work on regular files?  */
  165. /* typedef char *caddr_t; */ /* mmap argument type */
  166. #define mmap_signal SIGBUS /* signal received if you reference nonexistent part of mmapped file */
  167. #define has_rename 1 /* Does rename() work?  */
  168. #define bad_a_rename 1 /* Does rename(A,B) fail if A is unwritable?  */
  169. #define bad_b_rename 1 /* Does rename(A,B) fail if B is unwritable?  */
  170. /* typedef int void; */ /* Some ancient compilers need this.  */
  171. #define VOID (void) /* 'VOID e;' discards the value of an expression 'e'.  */
  172. #define has_seteuid 0 /* Does seteuid() work?  See README.  */
  173. #define has_setuid 0 /* Does setuid() exist?  */
  174. #define has_signal 1 /* Does signal() work?  */
  175. #define signal_args P((int)) /* arguments of signal handlers */
  176. #define signal_type void /* type returned by signal handlers */
  177. #define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()?  */
  178. #define has_sigaction 0 /* Does struct sigaction work?  */
  179. #define has_sigblock 0 /* Does sigblock() work?  */
  180. /* #define sigmask(s) (1 << ((s)-1)) */ /* Yield mask for signal number.  */
  181. #define has_sys_siglist 0 /* Does sys_siglist[] work?  */
  182. typedef ssize_t fread_type; /* type returned by fread() and fwrite() */
  183. typedef size_t freadarg_type; /* type of their size arguments */
  184. typedef void *malloc_type; /* type returned by malloc() */
  185. #define has_getcwd 1 /* Does getcwd() work?  */
  186. #define has_getwd 0 /* Does getwd() work?  */
  187. #define has_mktemp 1 /* Does mktemp() work?  */
  188. #define has_NFS 1 /* Might NFS be used?  */
  189. /* #define strchr index */ /* Use old-fashioned name for strchr()?  */
  190. /* #define strrchr rindex */ /* Use old-fashioned name for strrchr()?  */
  191. #define bad_unlink 1 /* Does unlink() fail on unwritable files?  */
  192. #define has_vfork 0 /* Does vfork() work?  */
  193. #define has_fork 0 /* Does fork() work?  */
  194. #define has_spawn 1 /* Does spawn*() work?  */
  195. #define has_wait 0 /* Does wait() work?  */
  196. #define has_waitpid 0 /* Does waitpid() work?  */
  197. /* #define RCS_SHELL getenv("COMSPEC") */ /* shell to run RCS subprograms */
  198. #define has_vfprintf 1 /* Does vfprintf() work?  */
  199. #define has__doprintf 0 /* Does _doprintf() work?  */
  200. #define has__doprnt 0 /* Does _doprnt() work?  */
  201. /* #undef EXIT_FAILURE */ /* Uncomment this if EXIT_FAILURE is broken.  */
  202. #define large_memory 0 /* Can main memory hold entire RCS files?  */
  203. #ifndef LONG_MAX
  204. #define LONG_MAX 2147483647L /* long maximum */
  205. #endif
  206. /* Do struct stat s and t describe the same file?  Answer d if unknown.  */
  207. #define same_file(s,t,d) (d)
  208. #define has_utimbuf 0 /* Does struct utimbuf work?  */
  209. #define CO "co.exe" /* name of 'co' program */
  210. #define COMPAT2 0 /* Are version 2 files supported?  */
  211. #define DATEFORM "%.2d.%.2d.%.2d.%.2d.%.2d.%.2d" /* e.g. 01.01.01.01.01.01 */
  212. #define DIFF "diff.exe" /* name of 'diff' program */
  213. #define DIFF3 "diff3.exe" /* name of 'diff3' program */
  214. #define DIFF3_A 1 /* Does diff3 have an -A option?  */
  215. #define DIFF3_BIN 1 /* Is diff3 user-visible (not the /usr/lib auxiliary)?  */
  216. #define DIFF_FLAGS , "-an" /* Make diff output suitable for RCS.  */
  217. #define DIFF_L 1 /* Does diff -L work? */
  218. #define DIFF_SUCCESS 0 /* DIFF status if no differences are found */
  219. #define DIFF_FAILURE 1 /* DIFF status if differences are found */
  220. #define DIFF_TROUBLE 2 /* DIFF status if trouble */
  221. /* #define ED "/bin/ed" */ /* name of 'ed' program (used only if !DIFF3_BIN) */
  222. #define MERGE "merge.exe" /* name of 'merge' program */
  223. #define TMPDIR "c:" /* default directory for temporary files */
  224. #define SLASH '/' /* principal pathname separator */
  225. #define SLASHes SLASH: case '\\': case ':' /* `case SLASHes:' labels all pathname separators */
  226. int isSLASH P((int));
  227. #define ROOTPATH(p) (isSLASH((p)[0]) || (p)[0] && (p)[1]==':') /* Is p an absolute pathname?  */
  228. #define X_DEFAULT "" /* default value for -x option */
  229. #define ALL_ABSOLUTE 0 /* Do all subprograms satisfy ROOTPATH?  */
  230. #define DIFF_ABSOLUTE 0 /* Is ROOTPATH(DIFF) true?  */
  231. /* #define SENDMAIL "/bin/mail" */ /* how to send mail */
  232. #define TZ_must_be_set 1 /* Must TZ be set for gmtime() to work?  */
  233.  
  234.  
  235.  
  236. /* Adjust the following declarations as needed.  */
  237.  
  238.  
  239. #ifndef exiting
  240. #    if __GNUC__ && !__STRICT_ANSI__
  241. #        define exiting volatile /* GCC extension: function cannot return */
  242. #    else
  243. #        define exiting
  244. #    endif
  245. #endif
  246.  
  247. #if has_ftruncate
  248.     int ftruncate P((int,off_t));
  249. #endif
  250.  
  251. /* <sys/mman.h> */
  252. #if has_madvise
  253.     int madvise P((caddr_t,size_t,int));
  254. #endif
  255. #if has_mmap
  256.     caddr_t mmap P((caddr_t,size_t,int,int,int,off_t));
  257.     int munmap P((caddr_t,size_t));
  258. #endif
  259.  
  260.  
  261. /* Posix (ISO/IEC 9945-1: 1990 / IEEE Std 1003.1-1990) */
  262. /* These definitions are for the benefit of non-Posix hosts, and */
  263. /* Posix hosts that have Standard C compilers but traditional include files.  */
  264. /* Unfortunately, mixed-up hosts are all too common.  */
  265.  
  266. /* <fcntl.h> */
  267. #ifdef F_DUPFD
  268.     int fcntl P((int,int,...));
  269. #else
  270.     int dup2 P((int,int));
  271. #endif
  272. #ifdef O_CREAT
  273. #    define open_can_creat 1
  274. #else
  275. #    define open_can_creat 0
  276. #    define O_RDONLY 0
  277. #    define O_WRONLY 1
  278. #    define O_RDWR 2
  279. #    define O_CREAT 01000
  280. #    define O_TRUNC 02000
  281.     int creat P((char const*,mode_t));
  282. #endif
  283. #ifndef O_EXCL
  284. #define O_EXCL 0
  285. #endif
  286.  
  287. /* <pwd.h> */
  288. #if has_getpwuid
  289.     struct passwd *getpwuid P((uid_t));
  290. #endif
  291.  
  292. /* <signal.h> */
  293. #if has_sigaction
  294.     int sigaction P((int,struct sigaction const*,struct sigaction*));
  295.     int sigaddset P((sigset_t*,int));
  296.     int sigemptyset P((sigset_t*));
  297. #else
  298. #if has_sigblock
  299.     /* BSD */
  300.     int sigblock P((int));
  301.     int sigmask P((int));
  302.     int sigsetmask P((int));
  303. #endif
  304. #endif
  305.  
  306. /* <stdio.h> */
  307. #if declare_fdopen
  308. FILE *fdopen P((int,char const*));
  309. #endif
  310. /* int fileno P((FILE*)); */
  311.  
  312. /* <sys/stat.h> */
  313. /* int chmod P((char const*,mode_t)); */
  314. /* int fstat P((int,struct stat*)); */
  315. /* int stat P((char const*,struct stat*)); */
  316. #if has_fchmod
  317.     int fchmod P((int,mode_t));
  318. #endif
  319. #ifndef S_IRUSR
  320. #    ifdef S_IREAD
  321. #        define S_IRUSR S_IREAD
  322. #    else
  323. #        define S_IRUSR 0400
  324. #    endif
  325. #    ifdef S_IWRITE
  326. #        define S_IWUSR S_IWRITE
  327. #    else
  328. #        define S_IWUSR (S_IRUSR/2)
  329. #    endif
  330. #endif
  331. #ifndef S_IRGRP
  332. #    if has_getuid
  333. #        define S_IRGRP (S_IRUSR / 0010)
  334. #        define S_IWGRP (S_IWUSR / 0010)
  335. #        define S_IROTH (S_IRUSR / 0100)
  336. #        define S_IWOTH (S_IWUSR / 0100)
  337. #    else
  338.         /* single user OS -- not Posix or Unix */
  339. #        define S_IRGRP 0
  340. #        define S_IWGRP 0
  341. #        define S_IROTH 0
  342. #        define S_IWOTH 0
  343. #    endif
  344. #endif
  345. #ifndef S_ISREG
  346. #define S_ISREG(n) (! ((n)&S_IFDIR))
  347. #endif
  348.  
  349. /* <sys/wait.h> */
  350. #if has_wait
  351.     pid_t wait P((int*));
  352. #endif
  353. #ifndef WEXITSTATUS
  354. #define WEXITSTATUS(stat_val) (stat_val)
  355. #undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix.  */
  356. #endif
  357. #ifndef WIFEXITED
  358. #define WIFEXITED(stat_val) ((stat_val) != -1)
  359. #endif
  360.  
  361. /* <unistd.h> */
  362. char *getlogin P((void));
  363. int close P((int));
  364. int isatty P((int));
  365. int link P((char const*,char const*));
  366. int open P((char const*,int,...));
  367. /* int unlink P((char const*)); */
  368. /* int _filbuf P((FILE*)); *//* keeps lint quiet in traditional C */
  369. /* int _flsbuf P((int,FILE*)); *//* keeps lint quiet in traditional C */
  370. long pathconf P((char const*,int));
  371. ssize_t write P((int,void const*,size_t));
  372. #ifndef STDIN_FILENO
  373. #    define STDIN_FILENO 0
  374. #    define STDOUT_FILENO 1
  375. #    define STDERR_FILENO 2
  376. #endif
  377. #if has_fork
  378. #    if !has_vfork
  379. #        undef vfork
  380. #        define vfork fork
  381. #    endif
  382.     pid_t vfork P((void)); /* vfork is nonstandard but faster */
  383. #endif
  384. #if has_getcwd || !has_getwd
  385. #    define getcwd(p,s) getcwdsl(p,s)
  386.     char *getcwdsl P((char*,size_t));
  387. #else
  388.     char *getwd P((char*));
  389. #endif
  390. #if has_getuid
  391.     uid_t getuid P((void));
  392. #endif
  393. #if has_readlink
  394.     ssize_t readlink P((char const*,char*,size_t)); /* BSD; not standard yet */
  395. #endif
  396. #if has_setuid
  397. #    if !has_seteuid
  398. #        undef seteuid
  399. #        define seteuid setuid
  400. #    endif
  401.     int seteuid P((uid_t));
  402.     uid_t geteuid P((void));
  403. #endif
  404. #if has_spawn
  405.     int spawnv P((int,char const*,char*const*));
  406. #    if ALL_ABSOLUTE
  407. #        define spawn_RCS spawnv
  408. #    else
  409. #        define spawn_RCS spawnvpq
  410.         int spawnvpq P((int,char const*,char*const*));
  411. #    endif
  412. #else
  413.     int execv P((char const*,char*const*));
  414. #    if ALL_ABSOLUTE
  415. #        define exec_RCS execv
  416. #    else
  417. #        define exec_RCS execvp
  418.         int execvp P((char const*,char*const*));
  419. #    endif
  420. #endif
  421.  
  422. /* utime.h */
  423. #if !has_utimbuf
  424.     struct utimbuf { time_t actime, modtime; };
  425. #endif
  426. int utime P((char const*,struct utimbuf const*));
  427.  
  428.  
  429. /* Standard C library */
  430. /* These definitions are for the benefit of hosts that have */
  431. /* traditional C include files, possibly with Standard C compilers.  */
  432. /* Unfortunately, mixed-up hosts are all too common.  */
  433.  
  434. /* <errno.h> */
  435. /* extern int errno; */
  436.  
  437. /* <signal.h> */
  438. #if has_signal
  439. /*     signal_type (*signal P((int,signal_type(*)signal_args)))signal_args; */
  440. #endif
  441.  
  442. /* <stdio.h> */
  443. /* FILE *fopen P((char const*,char const*)); */
  444. /* fread_type fread P((void*,freadarg_type,freadarg_type,FILE*)); */
  445. /* fread_type fwrite P((void const*,freadarg_type,freadarg_type,FILE*)); */
  446. int fclose P((FILE*));
  447. /* int feof P((FILE*)); */
  448. /* int ferror P((FILE*)); */
  449. int fflush P((FILE*));
  450. /* int fprintf P((FILE*,char const*,...)); */
  451. /* int fputs P((char const*,FILE*)); */
  452. int fseek P((FILE*,long,int));
  453. /* int printf P((char const*,...)); */
  454. /* int rename P((char const*,char const*)); */
  455. /* int sprintf P((char*,char const*,...)); */
  456. long ftell P((FILE*));
  457. /* void clearerr P((FILE*)); */
  458. /* void perror P((char const*)); */
  459. #ifndef L_tmpnam
  460. #define L_tmpnam 32 /* power of 2 > sizeof("/usr/tmp/xxxxxxxxxxxxxxx") */
  461. #endif
  462. #ifndef SEEK_SET
  463. #define SEEK_SET 0
  464. #endif
  465. #if has_mktemp
  466.     char *mktemp P((char*)); /* traditional */
  467. #else
  468.     char *tmpnam P((char*));
  469. #endif
  470. #if has_vfprintf
  471. /*     int vfprintf P((FILE*,char const*,va_list)); */
  472. #else
  473. #if has__doprintf
  474.     void _doprintf P((FILE*,char const*,va_list)); /* Minix */
  475. #else
  476.     void _doprnt P((char const*,va_list,FILE*)); /* BSD */
  477. #endif
  478. #endif
  479.  
  480. /* <stdlib.h> */
  481. /* char *getenv P((char const*)); */
  482. exiting void _exit P((int));
  483. exiting void exit P((int));
  484. malloc_type malloc P((size_t));
  485. malloc_type realloc P((malloc_type,size_t));
  486. void free P((malloc_type));
  487. #ifndef EXIT_FAILURE
  488. #define EXIT_FAILURE 1
  489. #endif
  490. #ifndef EXIT_SUCCESS
  491. #define EXIT_SUCCESS 0
  492. #endif
  493. #if !has_fork && !has_spawn
  494.     int system P((char const*));
  495. #endif
  496.  
  497. /* <string.h> */
  498. /* char *strcpy P((char*,char const*)); */
  499. /* char *strchr P((char const*,int)); */
  500. /* char *strrchr P((char const*,int)); */
  501. /* int memcmp P((void const*,void const*,size_t)); */
  502. /* int strcmp P((char const*,char const*)); */
  503. /* size_t strlen P((char const*)); */
  504. /* void *memcpy P((void*,void const*,size_t)); */
  505. #if has_memmove
  506. /*   void *memmove P((void*,void const*,size_t)); */
  507. #endif
  508.  
  509. /* <time.h> */
  510. time_t time P((time_t*));
  511.